package com.infoland.afanmall.model.order.adapter;

import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.entity.MultiItemEntity;
import com.infoland.afanmall.R;
import com.infoland.afanmall.base.util.ToolsKit;
import com.infoland.afanmall.model.order.entity.OrderCartByResponse;

import java.util.List;

/**
 * 购物车下单的适配器
 */
public class OrderDownCartAdapter extends BaseQuickAdapter<OrderCartByResponse.CartListBean, BaseViewHolder> {


    public OrderDownCartAdapter(int layoutResId, @Nullable List<OrderCartByResponse.CartListBean> data) {
        super(R.layout.order_down_item, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, OrderCartByResponse.CartListBean item) {
        ImageView view = helper.getView(R.id.img);
        ToolsKit.setImgView(item.getF_url(), view);
        helper.setText(R.id.txt_content, "" + item.getGoods_name() + "");
        helper.setText(R.id.txt_gui_ge, "" + item.getSpecVal() + "");
        helper.setText(R.id.txt_price, "" + item.getGoods_price() + "");
        helper.setText(R.id.txt_count, "x" + item.getGoods_count() + "");
    }
}
